import httpFetch from "share/httpFetch"
import errorMessage from "share/errorMessage";

export default {

  getInvoiceList(page, size, params) {
    return httpFetch.post(`/receipt/api/receipt/vicp/list`, { page, size, ...params })
      .catch(e => {
        errorMessage(e.response);
        throw e;
      });
  },

  //OCR扫描发票图片
  scanBase64(imageData) {
    return httpFetch.post(`/api/expense/reports/bag/receipt/scan`, {
      imageData,
      entityId: null,
      entityType: 'VICP'
    }).catch(e => {
      errorMessage(e.response);
      throw e;
    })
  },

  exportReceipt() {
    return httpFetch.post(`/receipt/api/receipt/vicp/export`, {}, {}, {responseType: 'arraybuffer'})
  },

}
